package com.da.javatest.leetCode;

/**
 * @author chenlida
 * @date 2019/1/19 14:09
 * @description
 */
public class Code392 {
    public boolean isSubsequence(String s, String t) {
        if (s == null || s.equals("")) {
            return true;
        }
        char[] c1 = s.toCharArray();
        int index = 0;
        for (char c : t.toCharArray()) {
            if (c == c1[index]) {
                index++;
            }
            if (index == c1.length) {
                return true;
            }
        }
        return false;
    }
}
